home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
borland
/
tpwn31.zip
/
PASCAL.ZIP
/
OLE.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1992-04-06
|
29KB
|
631 lines
{*******************************************************}
{ }
{ Turbo Pascal for Windows Run-time Library }
{ Windows 3.1 API Interface Unit }
{ }
{ Copyright (c) 1991 Borland International }
{ }
{*******************************************************}
unit OLE;
interface
uses WinTypes;
{ Object types }
const
ot_Link = 1;
ot_Embedded = 2;
ot_Static = 3;
{ activate verbs }
oleverb_Primary = 0;
type
POleTargetDevice = ^TOleTargetDevice;
TOleTargetDevice = record
otdDeviceNameOffset: Word;
otdDriverNameOffset: Word;
otdPortNameOffset: Word;
otdExtDevmodeOffset: Word;
otdExtDevmodeSize: Word;
otdEnvironmentOffset: Word;
otdEnvironmentSize: Word;
otdData: array[0..0] of Byte;
end;
const
{ flags used in some methods }
of_Set = $0001;
of_Get = $0002;
of_Handler = $0004;
{ return codes for OLE functions }
type
TOleStatus = Word;
const
ole_OK = 0; { 0 Function operated correctly }
ole_Wait_For_Release = 1; { 1 Command has been initiated, client }
{ must wait for release. keep dispatching }
{ messages till ole_RELESE in callback }
ole_Busy = 2; { 2 Tried to execute a method while another }
{ method is in progress. }
ole_Error_Protect_Only = 3; { 3 Ole APIs are called in real mode }
ole_Error_Memory = 4; { 4 Could not alloc or lock memory }
ole_Error_Stream = 5; { 5 (TOleStream) stream error }
ole_Error_Static = 6; { 6 Non static object expected }
ole_Error_Blank = 7; { 7 Critical data missing }
ole_Error_Draw = 8; { 8 Error while drawing }
ole_Error_Metafile = 9; { 9 Invalid metafile }
ole_Error_Abort = 10; { 10 Client chose to abort metafile drawing }
ole_Error_Clipboard = 11; { 11 Failed to get/set clipboard data }
ole_Error_Format = 12; { 12 Requested format is not available }
ole_Error_Object = 13; { 13 Not a valid object }
ole_Error_Option = 14; { 14 Invalid option (link update / render) }
ole_Error_Protocol = 15; { 15 Invalid protocol }
ole_Error_Address = 16; { 16 One of the pointers is invalid }
ole_Error_Not_Equal = 17; { 17 Objects are not equal }
ole_Error_Handle = 18; { 18 Invalid handle encountered }
ole_Error_Generic = 19; { 19 Some general error }
ole_Error_Class = 20; { 20 Invalid class }
ole_Error_Syntax = 21; { 21 Command syntax is invalid }
ole_Error_DataType = 22; { 22 Data format is not supported }
ole_Error_Palette = 23; { 23 Invalid color palette }
ole_Error_Not_Link = 24; { 24 Not a linked object }
ole_Error_Not_Empty = 25; { 25 Client doc contains objects. }
ole_Error_Size = 26; { 26 Incorrect buffer size passed to the api }
{ that places some string in caller's }
{ buffer }
ole_Error_Drive = 27; { 27 Drive letter in doc name is invalid }
ole_Error_Network = 28; { 28 Failed to establish connection to a }
{ network share on which the document }
{ is located }
ole_Error_Name = 29; { 29 Invalid name (doc name, object name), }
{ etc.. passed to the APIs }
ole_Error_Template = 30; { 30 Server failed to load template }
ole_Error_New = 31; { 31 Server failed to create new doc }
ole_Error_Edit = 32; { 32 Server failed to create embedded }
{ instance }
ole_Error_Open = 33; { 33 Server failed to open document, }
{ possible invalid link }
ole_Error_Not_Open = 34; { 34 Object is not open for editing }
ole_Error_Launch = 35; { 35 Failed to launch server }
ole_Error_Comm = 36; { 36 Failed to communicate with server }
ole_Error_Terminate = 37; { 37 Error in termination }
ole_Error_Command = 38; { 38 Error in execute }
ole_Error_Show = 39; { 39 Error in show }
ole_Error_DoVerb = 40; { 40 Error in sending do verb, or invalid }
{ verb }
ole_Error_Advise_Native = 41; { 41 Item could be missing }
ole_Error_Advise_Pict = 42; { 42 Item could be missing or server doesn't }
{ this format. }
ole_Error_Advise_Rename = 43; { 43 Server doesn't support rename }
ole_Error_Poke_Native = 44; { 44 Failure of poking native data to server }
ole_Error_Request_Native = 45; { 45 Server failed to render native data }
ole_Error_Request_Pict = 46; { 46 Server failed to render presentation }
{ data }
ole_Error_Server_Blocked = 47; { 47 Trying to block a blocked server or }
{ trying to revoke a blocked server }
{ or document }
ole_Error_Registration = 48; { 48 Server is not registered in regestation }
{ data base }
ole_Error_Already_Registered = 49;{ 49 Trying to register same doc multiple }
{ times }
ole_Error_Task = 50; { 50 Server or client task is invalid }
ole_Error_OutOfDate = 51; { 51 Object is out of date }
ole_Error_Cant_Update_Client = 52;{ 52 embed doc's client doesn't accept }
{ updates }
ole_Error_Update = 53; { 53 erorr while trying to update }
ole_Error_Setdata_Format = 54; { 54 Server app doesn't understand the }
{ format given to its SetData method }
ole_Error_Static_From_Other_OS = 55; { 55 trying to load a static object created }
{ on another Operating System }
{ Following are warnings }
ole_Warn_Delete_Data = 1000; { Caller must delete the data when he is }
{ done with it. }
{ Codes for CallBack events }
type
TOle_Notification = Word;
const
ole_Changed = 0; { 0 }
ole_Saved = 1; { 1 }
ole_Closed = 2; { 2 }
ole_Renamed = 3; { 3 }
ole_Query_Paint = 4; { 4 Interruptible paint support }
ole_Release = 5; { 5 Object is released (asynchronous operation }
{ is completed) }
ole_Query_Retry = 6; { 6 Query for retry when server sends busy ACK }
type
TOle_Release_Method = Word;
const
ole_None = 0; { 0 no method active }
ole_Delete = 1; { 1 object delete }
ole_LnkPaste = 2; { 2 PasteLink (auto reconnect) }
ole_EmbPaste = 3; { 3 paste (and update) }
ole_Show = 4; { 4 Show }
ole_Run = 5; { 5 Run }
ole_Activate = 6; { 6 Activate }
ole_Update = 7; { 7 Update }
ole_Close = 8; { 8 Close }
ole_Reconnect = 9; { 9 Reconnect }
ole_SetUpdateOptions = 10; { 10 setting update options }
ole_ServerUnlaunch = 11; { 11 server is being unlaunched }
ole_LoadFromStream = 12; { 12 LoadFromStream (auto reconnect) }
ole_SetData = 13; { 13 OleSetData }
ole_RequestData = 14; { 14 OleRequestData }
ole_O